#ifndef PITA_QUEUE_SOURCE_H_
#define PITA_QUEUE_SOURCE_H_

#include <boost/shared_ptr.hpp>

#include "interfaces/audio_source_interface.h"
#include "types.h"

namespace pita
{

	class QueueCursorInterface;

	class QueueSource : public AudioSourceInterface
	{
		public:
			QueueSource(QueueCursorInterface&);

			bool finished() const;
			bool isChunkReady() const;
			bool nextChunk(DataChunk&, unsigned int);

		private:
			void positionChanged();

			void updateCurrent() const;

		private:
			QueueCursorInterface* cursor_;

			mutable Index current_index_;
			mutable AudioSourceInterfacePtr current_;
	};

}

#endif
